﻿#pragma strict
public var vignetteBloque:Sprite;
public var unlock_stage_for_coins: Transform;
private var panneau:Transform;
function Start()
{
 	if(PlayerPrefs.GetInt("niveau3Bloque")==0)
	{
		if(PlayerPrefs.GetInt("scoreCumule")>=4500)
		{
			PlayerPrefs.SetInt("niveau3Bloque",1);
		}
		else
		{
			this.GetComponent(SpriteRenderer).sprite=vignetteBloque;
		}
	}
}

function OnMouseDown()
{
	if(!menuEnCour.menu)
	{
		if(PlayerPrefs.GetInt("niveau3Bloque")==1)
		{
			Application.LoadLevel("level5");
		}
		else
		{
			panneau=Transform.Instantiate(unlock_stage_for_coins);
			panneau.parent=this.transform;
			panneau.localScale=new Vector3(1,1,1);
		}
	}
}